home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / morse / bunn41ta / n4lta.lst < prev    next >
File List  |  1994-09-02  |  9KB  |  176 lines

  1.  
  2.  
  3.  
  4.                         ===== Parallax PIC16C5x Assembler v2.1 =====
  5.  
  6.  
  7.      1
  8.      2                                  ;This is a very simple program
  9.      3                                  ;to transmit a morse code
  10.      4                                  ;message with a PIC 16C54
  11.      5                                  ;microcontroller. The morse
  12.      6                                  ;message is constructed by
  13.      7                                  ;calling subroutines that
  14.      8                                  ;sends dits,dahs, and spaces
  15.      9                                  ;
  16.     10
  17.     11
  18.     12
  19.     13                                  ;START OF PROGRAM
  20.     14
  21.     15                                  ;Set the device type,osc type,WDT status
  22.     16                                  ;and code protect status
  23.     17
  24.     18
  25.     19     000-                                 DEVICE  PIC16C54,rc_OSC,WDT_OFF,PROTECT_OFF
  26.     20
  27.     21
  28.     22     1FF- A00                                     RESET   start           ;vector to 
  29.     23                                                                          ;here on 
  30.     24                                                                          ;reset
  31.     25
  32.     26     =0010                        Count0          equ     10h
  33.     27     =0011                        Count1          equ     11h             ;CW Speed 
  34.     28                                                                          ;timing bytes
  35.     29                                                                          ;labels
  36.     30
  37.     31
  38.     32     000- C80 005                 Start           mov     !RA,#10000000b  ;set bit7 
  39.     33                                                                          ;as an input
  40.     34                                                                          ;bit for 
  41.     35                                                                          ;future use
  42.     36                                                  
  43.     37     002- 92B                                     call WDSPC              ;wait 1 word
  44.     38                                                                          ;space and
  45.     39     003- 93A                                     CALL DAH                ;then send
  46.     40                                                                          ;the message
  47.     41     004- 933                                     CALL DIT                ;by calling
  48.     42                                                                          ;the appropriate
  49.     43     005- 933                                     CALL DIT                ;dits and
  50.     44     006- 927                                     CALL LETSPC             ;dahs. The dits
  51.     45                                                                          ;and dahs have
  52.     46     007- 933                                     CALL DIT                ;have spacing
  53.     47                                                                          ;built in
  54.     48
  55.     49     008- 92B                                     CALL WDSPC              ;DE
  56.     50
  57.     51     009- 93A                                     CALL DAH
  58.     52                                                  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.     53     00A- 933                                     CALL DIT
  66.     54     00B- 927                                     CALL LETSPC             ;N
  67.     55
  68.     56     00C- 933                                     CALL DIT
  69.     57     00D- 93A                                     CALL Dah
  70.     58     00E- 93A                                     CALL Dah
  71.     59     00F- 93A                                     CALL Dah
  72.     60     010- 93A                                     CALL DAH
  73.     61     011- 927                                     CALL LETSPC             ;1
  74.     62
  75.     63     012- 933                                     CALL DIT
  76.     64     013- 933                                     CALL Dit
  77.     65     014- 93A                                     CALL Dah
  78.     66     015- 933                                     CALL DIT
  79.     67     016- 927                                     CALL LETSPC             ;F
  80.     68
  81.     69                                                  
  82.     70     017- 93A                                     CALL DAH
  83.     71     018- 933                                     call dit
  84.     72     019- 933                                     call dit
  85.     73     01A- 933                                     call dit
  86.     74     01B- 927                                     CALL LETSPC             ;B
  87.     75
  88.     76     01C- 92B                                     CALL WDSPC
  89.     77     01D- 92B                                     CALL WDSPC
  90.     78     01E- 92B                                     CALL WDSPC              ;WAIT
  91.     79                                                                          ;for 3
  92.     80                                                                          ;word spaces
  93.     81                                                                          ;and jump
  94.     82     01F- A00                                     jmp start               ;to the 
  95.     83                                                                          ;beginning
  96.     84                                                                          ;to repeat
  97.     85                                                                          ;the message
  98.     86
  99.     87                                  ;DITIME is a routine that
  100.     88                                  ;generates a one dit timing
  101.     89                                  ;delay
  102.     90
  103.     91
  104.     92
  105.     93     020-                         DITIME                                  
  106.     94     020- C20 031                                 mov     Count1,#00100000b
  107.     95     022- 2F0 A22                 :Loop           djnz    Count0,:Loop
  108.     96     024- 2F1 A22                                 djnz    Count1,:Loop
  109.     97     026- 800                                     ret
  110.     98
  111.     99                                  ;LETSPC generates a letter space
  112.    100                                  ;delay
  113.    101
  114.    102
  115.    103     027- 920                     LETSPC          call DITIME
  116.    104     028- 920                                     call DITIME
  117.    105     029- 920                                     call DITIME             ;wait 3 ditimes
  118.    106     02A- 800                                     ret
  119.    107
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.    108                                  ;WDSPC generates a word space      
  127.    109                                  ;delay
  128.    110
  129.    111     02B- 920                     WDSPC           call DITIME
  130.    112     02C- 920                                     call DITIME
  131.    113     02D- 920                                     call DITIME
  132.    114     02E- 920                                     call DITIME
  133.    115     02F- 920                                     call DITIME
  134.    116     030- 920                                     call DITIME
  135.    117     031- 920                                     call DITIME             ;wait 7 ditimes
  136.    118     032- 800                                     ret
  137.    119
  138.    120                                  ;DIT sends a dit and waits 1 
  139.    121                                  ;morse space
  140.    122
  141.    123     033- C03 125                 DIT             or      RA,#00000011b   ;set bit0 and bit1
  142.    124                                                                          ;on
  143.    125     035- 920                                     call    DITIME
  144.    126
  145.    127     036- C00 165                                 and     RA,#00000000b   ;turn them off
  146.    128                                                  
  147.    129     038- 920                                     call    DITIME          ;wait 1 ditime
  148.    130     039- 800                                     ret
  149.    131
  150.    132
  151.    133                                  ;DAH sends a dah and waits one 
  152.    134                                  ;morse space
  153.    135
  154.    136
  155.    137     03A- C03 125                 DAH             or      RA,#00000011b   ;Bits 1,0 on
  156.    138     03C- 920                                     call    DITIME
  157.    139     03D- 920                                     call    DITIME
  158.    140     03E- 920                                     call    DITIME          ;wait 3 dits
  159.    141     03F- C00 165                                 and     RA,#00000000b   ;turn off
  160.    142                                                  
  161.    143     041- 920                                     call    DITIME          ;wait 1 ditime
  162.    144     042- 800                                     ret
  163.    145
  164.    146
  165.    147
  166.    148
  167.    149                                  ;End of the program
  168.    150                                  ;written by P Bunn, N4LTA
  169.    151                                  ;
  170.  
  171.  
  172.                                                     ===== Errors: 0 =====
  173.  
  174.  
  175.  
  176.